const {seq, DataTypes} = require('../sequelize')

const RoleAttributes = {
    name: {
        type: DataTypes.STRING,
        allowNull: false,
        Comment: '角色名',
        unique: true 
    },
    namecn: {
        type: DataTypes.STRING,
        allowNull: false,
        Comment: '角色名中文',
        unique: true 
    },
    state: { 
        type: DataTypes.BOOLEAN,
        defaultValue: true,
        Comment: '是否生效',
    }
}

const Role = seq.define('yyb_role',RoleAttributes, {
    createdAt: true,
    updatedAt: true,
    timestamps: false,
    freezeTableName: true
})

Role.sync() 

module.exports = {
    Role,
    RoleAttributes 
} 
